package edu.xidian.bdilab.jrbigdata.controller.admin;

import edu.xidian.bdilab.jrbigdata.controller.response.ResponseResult;
import edu.xidian.bdilab.jrbigdata.service.bank.dealStatics.DealStaticsService;
import edu.xidian.bdilab.jrbigdata.util.DecryptUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;

@CrossOrigin
@RestController
@Api(tags = {"Deal-成交记录"})
public class DealController {
    @Autowired
    DealStaticsService dealStaticsService;

    @ResponseBody
    @ApiOperation("查询金融产品")
    @RequestMapping(value = "/getDealProduct", method = RequestMethod.POST)
    public ResponseResult getDealProduct(@RequestParam(defaultValue = "1")@ApiParam(value = "页码") int pageNum,
                                             @RequestParam(defaultValue = "10")@ApiParam(value = "每页记录数") int pageSize,
                                             @RequestParam(required = false) @ApiParam(value = "金融机构名称（支持模糊查询）") String bankName,
                                             @RequestParam(required = false) @ApiParam(value = "产品名称（支持模糊查询）") String productName,
                                         @RequestParam(required = false) @ApiParam(value = "企业名称（支持模糊查询）") String enterpriseName,
                                         @RequestParam(required = false) @ApiParam(value = "企业代码（支持模糊查询）") String socialCode,
                                             HttpSession httpSession) throws Exception{
        ResponseResult responseResult = dealStaticsService.getDealProduct(pageNum,pageSize,bankName,productName,enterpriseName,socialCode);
        return responseResult;
    }
}
